<div class="row">
    <div class="col-md-12">
        <div class="widget stacked">
            <div class="widget-content">
                <div class="table-responsive">
                    <h1><?php echo $title; ?></h1>
                    <div class="pull-right">
                        <a class="btn btn-primary" href="<?php echo site_url('Doctor/Prescription/Create'); ?>"><?php echo $this->l('Create'); ?></a>
                        <a class="btn btn-default" href="<?php echo site_url('Doctor/Prescription/Create'); ?>"><?php echo $this->l('Status'); ?></a>
                    </div>
                    <table class="table">
                        <thead>
                          <tr>
                            <th>#</th>
                            <th><?php echo $this->l('Status'); ?></th>
                            <th><?php echo $this->l('Content'); ?></th>
                            <th><?php echo $this->l('Patient'); ?></th>
                            <th><?php echo $this->l('Date'); ?></th>
                            <th><?php echo $this->l('Actions'); ?></th>
                          </tr>
                        </thead>
                        <tbody>
                            <?php foreach ($prescriptions as $key => $value) { ?>
                                <tr>
                                    <td><?php echo $value->id_prescription; ?></td>
                                    <td><?php echo $value->status == 1 ? $this->l('On') : $this->l('Off'); ?></td>
                                    <td><a href="<?php echo site_url('Doctor/Prescription/Update/'.$value->id_prescription); ?>"><?php echo $value->content; ?></a></td>
                                    <td><?php echo $value->lastname.' '.$value->firstname; ?></td>
                                    <td>
                                        <?php $date = date_create_from_format('Y-m-d H:i:s', $value->date_add);
                                        echo date_format($date, 'd F Y').' at ';
                                        echo date_format($date, 'H:i A'); ?>
                                    </td>
                                    <td>
                                        <a class="btn btn-xs btn-success" href="<?php echo site_url('Doctor/Prescription/Update/'.$value->id_prescription); ?>"><i class="icon icon-edit"></i></a>
                                        <a class="btn btn-xs btn-primary" href="<?php echo site_url('Doctor/Prescription/send/?prescription='.$value->id_prescription.'&patient='.$value->id_patient); ?>"><i class="icon icon-envelope"></i></a>
                                        <a class="btn btn-xs btn-danger" href="<?php echo site_url('Doctor/Prescription/stop/'.$value->id_prescription); ?>"><i class="icon icon-remove-sign"></i></a>
                                    </td>
                                </tr>
                            <?php }  ?>                                                    
                        </tbody>
                    </table>
                </div>
            </div><!-- box-content -->
        </div><!-- /.box -->
    </div><!-- /.col (MAIN) -->
</div>
